package com.atguigu.cas;

import java.util.concurrent.atomic.AtomicInteger;

public class CASHello {
    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(5);
        System.out.println(atomicInteger.get());
        System.out.println(atomicInteger.compareAndSet(5,2025)+"\t"+atomicInteger.get());
        System.out.println(atomicInteger.compareAndSet(5,1111)+"\t"+atomicInteger.get());
        System.out.println(atomicInteger.incrementAndGet());
        System.out.println(atomicInteger.getAndIncrement()+"\t"+atomicInteger.get());
        System.out.println(atomicInteger.addAndGet(3));
    }

}
